﻿@model IEnumerable<WorkTimePrj.Models.ProjectCost>
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>项目工作量统计</title>
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <style type="text/css">
        body { color: #000000; }
        h2 { font-size: 10pt; font-family: simsun; background: #197B30; height: 35px; line-height: 35px; padding-left: 10px; color: #ffffff; font-weight: normal; }
        .WP_1 { width: 97%; margin: 15px auto; }
        .Btn01 { border: solid 1px #5381B3; color: #5381B3; }
        input[type='text'].TB01 { width: 135px; }
        table { border-collapse: collapse; margin: 15px 0; border: solid 1px #A5A5A5; }
        table tr th { background: #197B30; color: #ffffff; }
        table tr td { font-family: simsun; font-size: 12px; text-align: left; }
        .WP_2 { font-size: 10pt; margin-top: 15px; }
        .WP_7 { display: block; border: solid 1px #c0d6ef; background: #e4ecf5; margin-top: 15px; float: left; }
        /*.Lbl02{color:#ffffff; font-weight:normal;}*/
    </style>
    <script src="@Url.Content("~/Scripts/jquery-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/DatePicker/WdatePicker.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('#BtnExcel').click(function () {
                $('#HAction').val('export');
                window.document.forms[0].submit();
            });
        });
        function valDate() {
            var date1 = new Date();
            date1.setFullYear($dp.$D('TBStartTime').y, $dp.$D('TBStartTime').M - 1, $dp.$D('TBStartTime').d);
            var dayofwk1 = date1.getDay();
            var date2 = new Date();
            date2.setFullYear($dp.$D('TBEndTime').y, $dp.$D('TBEndTime').M - 1, $dp.$D('TBEndTime').d);
            var dayofwk2 = date2.getDay();
            //debugger
            if (dayofwk1 != 1 || dayofwk2 != 0) {
                alert('日期选择错误！');
                return false;
            }
            else {
                return true;
            }
        }
        function pickedFunc1() {
            var dayofwk = $dp.cal.getP('w');
            if (dayofwk != '01')
                alert('日期错误！只能选择星期一');
        }
        function pickedFunc2() {
            var dayofwk = $dp.cal.getP('w');
            if (dayofwk != '00')
                alert('日期错误！只能选择星期日');
        }
    </script>
</head>
<body>
    @using (Html.BeginForm(new { startTime = ViewBag.startTime, endTime = ViewBag.endTime }))
    {
        <div class="WP_1">
            <h2>
                项目工作量统计 &nbsp;&nbsp;&nbsp;<span class="Lbl02">@ViewBag.startTime</span> 至 <span class="Lbl02">@ViewBag.endTime</span>&nbsp;&nbsp;&nbsp;总计
                @ViewBag.cnt 条</h2>
            <div>
                <label class="Lbl01">
                    开始时间</label>&nbsp;&nbsp;&nbsp;<input id="TBStartTime" name="TBStartTime"  class="TB01" type="text" value="@ViewBag.startTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked:pickedFunc1})"/>
                <label class="Lbl01">
                    结束时间</label>&nbsp;&nbsp;&nbsp;<input id="TBEndTime"  name="TBEndTime" class="TB01" type="text" value="@ViewBag.endTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked:pickedFunc2})"/>
                <input id="BtnSubmit" type="button" class="Btn01" value="查询" onclick=" if (valDate) {
                  $('#HAction').val('');
                  window.document.forms[0].submit();
                  }" />&nbsp;&nbsp;&nbsp;
                <input id="BtnExcel" type="submit" class="Btn01" value="导出Excel" />
                <input id="HAction" name="HAction" type="hidden" value="@ViewBag.action"/>
            </div>
            @if (ViewBag.cnt != 0)
            {
                <table border="1">
                    <tr>
                        <th>
                            项目代码
                        </th>
                        <th>
                            项目名称
                        </th>
                        <th style="text-align: center;">
                            状态
                        </th>
                        <th style="text-align: center;">
                            PM
                        </th>
                        <th>
                            参与人员
                        </th>
                        <th>
                            售前 Cost
                        </th>
                        <th>
                            项目经理 Cost
                        </th>
                        <th>
                            技术支持 Cost
                        </th>
                        <th>
                            美工 Cost
                        </th>
                        <th>
                            开发 Cost
                        </th>
                        <th>
                            测试 Cost
                        </th>
                        <th>
                            合计
                        </th>
                    </tr>
                    @Html.EditorForModel()
                </table>
            }
            else
            {
                <span class="WP_7">无统计数据</span>
            }
        </div>
    }
</body>
</html>
